import {Button} from "element-ui";
import {auditType} from "./lib/ModalContent/types";
import {ClassifyProperties} from "./lib/Base/CommodityClassify/type";
import {AuditType} from "./lib/MainDisplay/types";

export interface pluginType {
    name: string; // 插件名称
    $root?: object; // 根组件实例
    beforeMount?: Function; // 插件挂载前方法
    afterMount?: Function;  // 插件卸载前方法
}

export interface MasterModalProps {
    visible?: boolean;
    title?: string;
    size?: "sm" | "md" | "lg";
    modal?: boolean,
    id?:string | string[],
    "close-on-click-modal"?:boolean
    "destroy-on-close"?:boolean;
    closeOnPressEscape?:boolean;
    businessType?: BusinessTypeEnum
    modalType: auditType
    plugins: pluginType[];
    currentPage?:number;
    statusFlag?:number
}

export interface MasterModalState {
    url: string;
    key:string

}

/**
 * commodityLicense - 国产注册
 * foreignLicense - 进口注册
 * domesticRecord - 国产备案
 * foreignRecord - 进口备案
 */
export type BusinessTypeEnum = "commodity" | "registration" | "brand" | "partnerLicense" | "commodityLicense" | "foreignLicense" | "domesticRecord" | "foreignRecord"

export interface BusinessType {
    businessType: "commodity" | "registration" | "brand" | "partnerLicense" | "commodityLicense" | "foreignLicense" | "domesticRecord" | "foreignRecord";
}

export interface ds{
    type: "session" | "interface"
    MasterModalState: MasterModalState
}


export interface AProps extends ds{
    default: ""
    props: keyof Button
}


export interface CommodityAuditRequestDto{
    "approve": boolean,
    "articleNo": string,
    "brandStandardCode": string,
    "classFirst": string,
    "classFourth": string,
    "classSecond": string,
    "classThird": string,
    "cnName": string,
    "comment": string,
    "commodityType": number,
    "description": string,
    "id": number,
    standardCode?:string,
    "licenseStandardCode": string,
    "managementCategory": string,
    "minSaleUnit": string,
    "packageParam": string,
    "physicalForm": string,
    "specification": string,
    "tagPicture": string,
    "tags": string[]
}

export interface CommodityAuditFields{
    approve: boolean,
    managementCategory: string,
    "classFirst": string,
    "classFourth"?: string,
    "classSecond"?: string,
    "classThird"?: string,
    "physicalForm": string,
    remark:string
    tags:string[]
}

export interface CommodityAuditInfo{
    approve: number,
    commodityCategory: ClassifyProperties,
    managementCategory: string,
    physicalForm: string,
    tags: string[],
    remark:string,
    code:string
}


export interface ClassData{
    classFirst:string;
    classSecond:string;
    classThird:string;
    classFourth:string;
}
export type AuditRequestFields = CommodityAuditFields
